<?php

namespace app\index\controller;

use app\common\controller\Frontend;

class Index extends Frontend
{

    protected $noNeedLogin = '*';
    protected $noNeedRight = '*';
    protected $layout = '';

    public function index()
    {
        $app_version=Db('app_version')
            ->where('id','>',0)
            ->order('id desc')->find();
        $this->view->assign('url', $app_version['url']);
        $this->view->assign('logo', '');
        $this->view->assign('name','' );
        $this->view->assign('version', $app_version['version']);
        $this->view->assign('time',  date('Y-m-d H:i:s',$app_version['create_time']));
        return $this->view->fetch();
    }

    public function download()
    {
        $app_version=Db('app_version')
            ->where('id','>',0)
            ->order('id desc')->find();
  /*      $logo = Settings::getSystem('logo');
        $name = Settings::getSystem('name');*/
        $view = [
            'url' => $app_version['url'],
     /*       'logo' => $logo,
            'name' => $name,*/
            'version' => $app_version['version'],
            'time' => date('Y-m-d H:i:s',$app_version['create_time']),
        ];
        return $this->view->fetch();

    }

}
